<template>
  <div id="app" class="app-wapper">
    <transition name="fade">
      <loading v-show="loadingShow"></loading>
    </transition>
    <consume-ok-popup></consume-ok-popup>
    
    <keep-alive>
        <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive"></router-view>
  </div>
</template>

<script>
import loading from "./components/loading/loading.vue";
import consumeOkPopup from "./components/popupBox/consumeOkPopup.vue";
import { mapState } from "vuex";
export default {
  name: "app",
  components: {
    loading,consumeOkPopup
  },
  data() {
    return {};
  },
  computed: {
    ...mapState(["loadingShow","consumeOkPopupShow"])
  },
  created() {},
  methods: {}
};
</script>

<style lang="stylus">
.fade-enter-active, .fade-leave-active {
  transition: opacity 0.25s;
}

.fade-enter, .fade-leave-to { /* .fade-leave-active below version 2.1.8 */
  opacity: 0;
}
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif, 'Microsoft YaHei';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  width: 100%;
  height: 100%;
}

.app-wapper {
  width: 100%;
  height: 100%;
  max-width 750px;
  margin 0 auto;

  .router-view {
    // height: 100%;
    box-sizing: border-box;
  }
}
</style>